package rc.work.module.infra.controller.admin.onlyoffice.officehistory;

import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "管理后台 - onlyoffice历史记录")
@RestController
@RequestMapping("/dev/office-history")
@Validated
public class OfficeHistoryController {

//    @Resource
//    private OfficeHistoryService officeHistoryService;
//
//    @PostMapping("/create")
//    @Operation(summary = "创建onlyoffice历史记录")
//    @PreAuthorize("@ss.hasPermission('dev:office-history:create')")
//    public CommonResult<Long> createOfficeHistory(@Valid @RequestBody OfficeHistorySaveReqVO createReqVO) {
//        return success(officeHistoryService.createOfficeHistory(createReqVO));
//    }

//    @PutMapping("/update")
//    @Operation(summary = "更新onlyoffice历史记录")
//    @PreAuthorize("@ss.hasPermission('dev:office-history:update')")
//    public CommonResult<Boolean> updateOfficeHistory(@Valid @RequestBody OfficeHistorySaveReqVO updateReqVO) {
//        officeHistoryService.updateOfficeHistory(updateReqVO);
//        return success(true);
//    }

//    @DeleteMapping("/delete")
//    @Operation(summary = "删除onlyoffice历史记录")
//    @Parameter(name = "id", description = "编号", required = true)
//    @PreAuthorize("@ss.hasPermission('dev:office-history:delete')")
//    public CommonResult<Boolean> deleteOfficeHistory(@RequestParam("id") Long id) {
//        officeHistoryService.deleteOfficeHistory(id);
//        return success(true);
//    }

//    @GetMapping("/get")
//    @Operation(summary = "获得onlyoffice历史记录")
//    @Parameter(name = "id", description = "编号", required = true, example = "1024")
//    @PreAuthorize("@ss.hasPermission('dev:office-history:query')")
//    public CommonResult<OfficeHistoryRespVO> getOfficeHistory(@RequestParam("id") Long id) {
//        OfficeHistoryDO officeHistory = officeHistoryService.getOfficeHistory(id);
//        return success(BeanUtils.toBean(officeHistory, OfficeHistoryRespVO.class));
//    }

//    @GetMapping("/page")
//    @Operation(summary = "获得onlyoffice历史记录分页")
//    @PreAuthorize("@ss.hasPermission('dev:office-history:query')")
//    public CommonResult<PageResult<OfficeHistoryRespVO>> getOfficeHistoryPage(@Valid OfficeHistoryPageReqVO pageReqVO) {
//        PageResult<OfficeHistoryDO> pageResult = officeHistoryService.getOfficeHistoryPage(pageReqVO);
//        return success(BeanUtils.toBean(pageResult, OfficeHistoryRespVO.class));
//    }

//    @GetMapping("/export-excel")
//    @Operation(summary = "导出onlyoffice历史记录 Excel")
//    @PreAuthorize("@ss.hasPermission('dev:office-history:export')")
//    @ApiAccessLog(operateType = EXPORT)
//    public void exportOfficeHistoryExcel(@Valid OfficeHistoryPageReqVO pageReqVO,
//              HttpServletResponse response) throws IOException {
//        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
//        List<OfficeHistoryDO> list = officeHistoryService.getOfficeHistoryPage(pageReqVO).getList();
//        // 导出 Excel
//        ExcelUtils.write(response, "onlyoffice历史记录.xls", "数据", OfficeHistoryRespVO.class,
//                        BeanUtils.toBean(list, OfficeHistoryRespVO.class));
//    }

}